#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int get_number_of_1(int n)
{
	int count = 0;
	while (n)
	{
		count++;
		n &= (n - 1);
	}
	return count;
}

int main()
{
	int n = 0;
	int num_of_1 = 0;
	scanf("%d", &n);
	num_of_1 = get_number_of_1(n);
	printf("%d", num_of_1);
	return 0;
}
